//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
        // to see how IntelliJ IDEA suggests fixing it.
        //System.out.printf("Hello and welcome!");
        Command command = new ConcreteCommand(); //定义命令

        System.out.println("test01:全大写-----------------------------------------");
        command.setReceiver(new UpperReceiver());   //设置命令及其对应的命令接收器
        Invoker textTool = new Invoker(command);    //设置调用者
        System.out.println(textTool.call("This is My Test."));

        System.out.println("test01:全小写-----------------------------------------");
        command.setReceiver(new LowerReceiver());     //变化点在这里，
        System.out.println(textTool.call("This is My Test."));

    }
}